const promise = new Promise((resolve, reject) => {
  setTimeout(() => {
    if (Math.random() < 0.5) {
      resolve('正常')
    } else {
      reject('异常')
    }
  }, 1000)
})

promise
  .then(res => {
    // 正常
    console.log(res)
  })
  .catch(res => {
    // 异常
    console.log(res)
  })
  .finally(() => {
    console.log('finally')
  })
